#ifndef __GAMELAYER_H__
#define __GAMELAYER_H__

#include "SceneController.h"
#include "stdlib.h"
#include "time.h"


using namespace cocos2d;
using namespace CocosDenshion;

class Box;
class IndexBox;
class PopupScene;

class GameLayer : public CCLayer
{
public:

	CCSize winSize;
	Box* box[30];
	IndexBox* indexBox;
	CCLabelTTF *lblScore;
	CCLabelTTF *lblCombo;
	CCLabelTTF *lblTime;
	CCString* returnRec;
	int basicScore;
	int score;
	int scoreCount;
	int idxColorId;
	int colorId;
	int numberId;
	int recNumber;
	int count;
	int combo;
	int comboState;
	int changeCounter;
	int timer;
	CCMenu* pMenu;

	virtual bool init();  
	void update(float dt);
	void timeUpdate(float dt);
	void comboUpdate(float dt);
    //virtual bool ccTouchBegan(CCTouch *pTouch, CCEvent* event);
	void ccTouchesBegan(CCSet *pTouches, CCEvent *pEvent);
	void ccTouchesMoved(CCSet *pTouches, CCEvent *pEvent);
	void ccTouchesEnded(CCSet *pTouches, CCEvent *pEvent);
	void changeBoxColor();
	void changeIdxColor();
	int randomId(int val);
    void clearClickSate();
    CCString* getChangeColor(int randomId);
    
	void popPause(CCObject* pSender);
    //void doMsgReceived(CCObject* obj);
    void popResult(int score);

    CREATE_FUNC(GameLayer);
    
};

#endif // __GAMELAYER_H__
